package com.js.auth.server.feign;

import com.js.auth.server.config.FeignConfig;
import com.js.common.response.ObjectRestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author： ygl
 * @date： 2018/10/29
 * @Description：
 * 用户数据接口
 */
@FeignClient(value = "${jwt.user-service}",configuration = FeignConfig.class)
public interface IUserService {

    /**
     * 通过账户\密码的方式登陆
     * @param username
     * @param password
     * @return
     */
    @PostMapping(value = "/user/validate")
    public ObjectRestResponse<Map<String,String>> validate(@RequestParam("username") String username, @RequestParam("password") String password);

    @PostMapping(value = "/user/info")
    public ObjectRestResponse<Map<String,String>> getUserInfoByUsername(@RequestParam("username") String username);
}
